from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.common.action_chains import ActionChains
from time import sleep
from options import options

driver = webdriver.Chrome(options=options)
driver.get(r'https://www.baidu.com/')
driver.maximize_window()
sleep(3)
ele1=driver.find_element(By.ID,'s-usersetting-top')
ActionChains(driver).move_to_element(ele1).perform()
sleep(1)
driver.find_element(By.XPATH,'//*[@id="s-user-setting-menu"]/div/a[1]/span').click()
sleep(2)
driver.find_element(By.LINK_TEXT,'保存设置').click()
sleep(1)
driver.switch_to.alert.accept()
sleep(3)
driver.quit()

